package com.twu.biblioteca.data_structures;

import java.io.PrintStream;

public class Movie {
    PrintStream ps;
    String title;
    String year;
    String director;
    String rating;

    public Movie(String title, String year, String director, String rating){
        this(title, year, director, rating, System.out);
    }

    public Movie(String title, String year, String director, String rating, PrintStream ps){
        this.ps = ps;
        this.title = title;
        this.year = year;
        this.director = director;
        this.rating = rating;
    }

    public void print() {
        String output = title + "|" + year + "|" + director + "|" + rating;
        if(rating.equals(""))
            output += "N/A";
        ps.println(output);
    }
}
